package com.liangxy.zhyl.mapper;

import com.liangxy.zhyl.entity.NursingProject;
import com.liangxy.zhyl.vo.NursingProjectVo;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.web.bind.annotation.DeleteMapping;

import java.util.List;

@Mapper
public interface NursingProjectMapper {

    /**
     * 分页查询护理项目列表
     *
     * @param name  项目名称
     * @param status 状态
     * @return
     */
    List<NursingProjectVo> getByPage(String name, Integer status);

    void insert(NursingProject nursingProject);

    NursingProject selectById(Long id);

    void update(NursingProject nursingProject);

    /**
     * 查询所有的护理项目
     * @return
     */
    List<NursingProjectVo> getAll();

    /**
     * 启用/禁用 护理项目
     * @param id
     * @param status
     */
    void updateStatus(@Param("id") Long id, @Param("status") Integer status);

    /**
     * 删除护理项目
     * @param id
     */
    @Delete("delete from nursing_project where id = #{id}")
    void deleteById(@Param("id") Long id);
}
